@extends('admin.layout.layout')

@section('content')

    @if(session('error'))
        <div class="col-xs-12 alert alert-danger">
            <center><p>{{session('error')}}</p></center>
        </div>
    @elseif(session('success'))
        <div class="col-xs-12 alert alert-success">
            <center><p class="delmes1">{{session('success')}}</p></center>
        </div>
    @endif
    <center>
    <!-- 其他地方操作提示信息元素 -->
        <div class="delmes2"></div>
    </center>

<!-- 商品分类操作提示 -->
    <div class="panel-body">
        <div class="dataTable_wrapper">
            <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
            <form action="" method="GET">
            <div class="row">
                <div class="col-sm-4">
                <div class="dataTables_length" id="dataTables-example_length">
                    <label>显示 
                        <select name="num" aria-controls="dataTables-example" class="form-control input-sm">
                            <option value="5" @if(!empty($data['num']) && $data['num'] == 5) { selected } @endif>10</option>
                            <option value="10" @if(!empty($data['num']) && $data['num'] == 10) { selected } @endif>20</option>
                            <option value="20" @if(!empty($data['num']) && $data['num'] == 20) { selected } @endif>30</option>
                            <option value="30" @if(!empty($data['num']) && $data['num'] == 30) { selected } @endif>40</option>
                        </select> 条记录
                    </label>
                </div>
                </div>
                <div class="col-sm-4 col-sm-offset-4">
                <div id="dataTables-example_filter" class="dataTables_filter">
                    <label> 类名:<input type="text" value="{{$data['search'] or ''}}" class="form-control input-sm" name="search" aria-controls="dataTables-example">
                    </label>
                    <button class="btn btn-primary btn-sm">查 询</button>
                </div>
                </div>
            </div>
            </form>
            <div class="row">
                <div class="col-sm-12">
                    <table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example" role="grid" aria-describedby="dataTables-example_info">
                        <thead>
                            <tr role="row">
                            <th tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">商品分类id</th>
                            <th tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">商品分类名</th>
                            <th tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">商品 平均 评星</th>
                            <th tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">支持 最高的评论</th>
                            <th tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">操作</th>
                            </tr>
                        </thead>
                        <tbody>    
                        @foreach($goodsinfo as $v)
                        <tr class="gradeA odd" role="row">
                                <td class="sorting_1 id">{{$v->id}}</td>
                                <td>{{$v->goodsname}}</td>
                                <td>
                                @for($i = 0; $i < $v->star; $i++)
                                <span class="glyphicon glyphicon-star" style="color:red"></span>
                                @endfor
                                <span>&nbsp&nbsp{{$v->star}}星</span>
                                </td>
                                <td>{{$v->contents}}</td>
                                <td>
                                    <a href="/admin/comments/edit?id={{$v->id}}"> 编辑 | 查看 </a>
                                    <a href="javascript:void(0)" class="del"> 删 除</a>
                                </td>
                        </tr>
                        @endforeach
                        </tbody>
                    </table>
            </div>
                </div>
                    <div class="row">
                        <div class="col-sm-6">
                           
                        </div>
                    </div>
                </div>
            </div>
                <!-- /.table-responsive -->
        </div>
<script src="/public/admin/js/cate.js"></script>

@endsection